package com.example.onlinemusic.service;

import com.example.onlinemusic.mapper.MusicMapper;
import com.example.onlinemusic.model.Music;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class MusicService {

    @Autowired
    private MusicMapper musicMapper;


    public int dataInsert( String title, String singer, String time, String url, int userid){
        return musicMapper.dataInsert(title, singer, time, url, userid);
    }

    public Music select(String title , String singer){

        return musicMapper.select(title,singer);
    }

    public Music getMusicById(Integer id){

        return musicMapper.getMusicById(id);
    }

    public int delete(Integer id){

        return musicMapper.delete(id);
    }

    public List<Music> getMusic(){

        return musicMapper.getMusic();
    }

    public List<Music> getMusicByName(String musicName){

        return musicMapper.getMusicByName(musicName);
    }
}
